import BaseController from '../../../base/base-controller';
import { Get, Prefix, Render,Before } from 'egg-shell-decorators';
import HomeService from '../../../service/login/home/home-service'
const auth = require('../../../middleware/session_filter');

@Prefix('/')
export default class LoginController extends BaseController {

    private readonly homeService: HomeService = this.ctx.service.login.home.homeService

    @Render
    @Get('home')
    @Before([ auth ])
    public async login(): Promise<any> {
        await this.homeService.init()
        await this.ctx.render('login/home/frame.njk',{entrance: 'login/home'})
    }
}
